package com.ruoyi.boat.task;

import com.ruoyi.boat.domain.*;
import com.ruoyi.boat.service.*;
import com.ruoyi.boat.ws.WebSocketObject;
import com.ruoyi.boat.ws.WebsocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Component
public class Task {

    @Autowired
    WebsocketService websocketService;

    @Autowired
    IBoatService boatService;

    @Autowired
    IStatusService statusService;

    @Autowired
    IAlertService alertService;

    @Autowired
    IMeteorDataService meteorDataService;

    @Autowired
    IWaveDataService waveDataService;

    @Autowired
    IAdcpDataService adcpDataService;

    @Autowired
    ICtdDataService ctdDataService;

    @Autowired
    IAtmosDataService atmosDataService;

    @Autowired
    IAisDataService aisDataService;

    @Autowired
    IRadarDataService radarDataService;

    @Autowired
    IWaterQualityService waterQualityService;

    @Autowired
    IStatisticService statisticService;

    private static int serialNum = 0;

    /**
     * 模拟收到状态向前端发送
     */
    public void mockStatus() {
        List<Boat> boats = boatService.selectBoatList(new Boat());
        for (Boat boat : boats) {
            Status status = new Status()
                    .setSerialNum(++serialNum)
                    .setBoatCode(boat.getCode())
                    .setLng(120.0 + Math.random())
                    .setLat(30.0 + Math.random())
                    .setDestNum(0)
                    .setSpeed(Math.random() * 30)
                    .setRudderAngle((int) Math.floor(Math.random() * 60 - 30))
                    .setHeadingUp(Math.floor(Math.random() * 360))
                    .setHeadingDown(Math.floor(Math.random() * 360))
                    .setPitchUp((int) Math.floor(Math.random() * 40 - 20))
                    .setPitchDown((int) Math.floor(Math.random() * 40 - 20))
                    .setRollUp((int) Math.floor(Math.random() * 40 - 20))
                    .setVoltage1(Math.random() * 30)
                    .setVoltage2(Math.random() * 30)
                    .setVoltage3(Math.random() * 30)
                    .setControlMode(Math.random() >= 0.5 ? 1 : 0)
                    .setAlert(0)
                    .setRotationUp((int) Math.floor(Math.random() * 256))
                    .setRotationDown((int) Math.floor(Math.random() * 256))
                    .setPressure((int) Math.floor(Math.random() * 256))
                    .setSystemStatus((int) (Math.floor(Math.random() * 10) % 3))
                    .setActuatorStatus((int) (Math.floor(Math.random() * 10) % 3))
                    .setLoadStatus((int) (Math.floor(Math.random() * 10) % 3))
                    .setDeviation(Math.random() * 10)
                    .setTime(new Date());
            status.setCapacitor(Math.random() * 100);
//            status.setCapacitor((status.getVoltage1() - 22.4) / 7.0 * 100.0);


            // 目标点增加且不是FF的时候 计算航迹偏差 FF的时候计算驻留偏差


            // 判断航迹是否结束 第一条FF表示结束

            // 收到状态
            statusService.insertStatus(status);
            // 发送给前端更新网页数据
            websocketService.sendStatus(status);

            // 判断报警


            // 现根据code获取设置的报警有哪些 可以做个缓存 当编辑了之后 更新缓存
            List<Alert> alerts = alertService.selectAlertList(new Alert().setBoatCode(status.getBoatCode()));
            for (Alert alert : alerts) {
                if (alert.getType() == 1) {

                } else if (alert.getType() == 2) {

                }
            }
            // 判断开关量 和 判断其他报警, 超时报警 需要一个定时任务去处理 恶意靠近 根据ais信息 低电量？
            // 报警分为 报警和解除报警
            // 判断当前数据库状态和发来的status里的状态是否一样 不一样插入alert_history 更改alert的status 并发送给前端
            // 然后再根据boatId 去查找报警人 发送email


        }
    }

    public void mockInsertStatus() {
        for (int i = 0; i < 100; i++) {
            mockStatus();
        }
    }

    public void mockInsertCtd() {
        for (int i = 0; i < 100; i++) {
            mockCtdData("00");
        }
    }

    public void mockMeteorData(String boatCode) {
        if (boatCode == null) boatCode = "00";
        MeteorData meteorData = new MeteorData().setBoatCode(boatCode)
                .setWindDirection(Math.floor(Math.random() * 365))
                .setWindSpeed(Math.round(Math.random() * 10 * 100) / 100.0)
                .setTemp(Math.round(Math.random() * 20 * 100) / 100.0)
                .setHumidity(Math.round(Math.random() * 10 * 100) / 100.0)
                .setPressure((Math.round(Math.random() * 200 + 800) * 100) / 100.0)
                .setRain(Math.round(Math.random() * 10 * 100) / 100.0)
                .setTime(new Date());

        meteorDataService.insertMeteorData(meteorData);
        websocketService.sendMeteorData(meteorData);
    }

    public void mockWaveData(String boatCode) {
        if (boatCode == null) boatCode = "00";
        WaveData data = new WaveData().setBoatCode(boatCode)
                .setAverageHeight(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setAveragePeriod(Math.round(Math.random() * 10 * 100) / 100.0)
                .setMaxHeight(Math.floor(Math.random() * 40 * 100) / 100.0)
                .setMaxPeriod(Math.round(Math.random() * 10 * 100) / 100.0)
                .setOneTenthHeight(Math.floor(Math.random() * 30 * 100) / 100.0)
                .setOneTenthPeriod(Math.round(Math.random() * 10 * 100) / 100.0)
                .setSignificantHeight(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setSignificantPeriod(Math.round(Math.random() * 10 * 100) / 100.0)
                .setNumber((int) Math.round(Math.random() * 100))
                .setDirection((int) Math.round(Math.random() * 100))
                .setTime(new Date());

        waveDataService.insertWaveData(data);
        websocketService.sendWaveData(data);
    }

    public void mockWaterQuality(String boatCode) {
        if (boatCode == null) boatCode = "00";
        WaterQuality data = new WaterQuality().setBoatCode(boatCode)
                .setTemp(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setDepth(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setSalinity(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setOxygen(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setChlorophyll(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setTurbidity(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setPh(Math.floor(Math.random() * 14 * 100) / 100.0)
                .setTime(new Date());
        waterQualityService.insertWaterQuality(data);
        websocketService.sendWaterQuality(data);
    }

    public void mockAtmosData(String boatCode) {
        if (boatCode == null) boatCode = "00";
        AtmosData data = new AtmosData().setBoatCode(boatCode)
                .setType(1)
                .setCeilHeight(Math.floor(Math.random() * 40 * 100) / 100.0)
                .setBottomHeight(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setThickness(Math.floor(Math.random() * 20 * 100) / 100.0)
                .setStrength(Math.floor(Math.random() * 10 * 100) / 100.0)
                .setTime(new Date());
        atmosDataService.insertAtmosData(data);
        websocketService.sendAtmosData(data);
    }

    public static double twoDecimal(double num) {
        return Math.floor(num * 100) / 100;
    }

    public static double toFixed(double num, int digitalCount) {
        return Math.floor(num * Math.pow(10, digitalCount)) / Math.pow(10, digitalCount);
    }

    public void mockRadarData(String boatCode) {
        if (boatCode == null) boatCode = "00";
        List<List<String>> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(new ArrayList<>());
        }
        for (int i = 0; i < 10; i++) {

            list.get(0).add(String.valueOf(0.5 * i)); // 第1个距离库的距离
            list.get(1).add(String.valueOf(twoDecimal(10 + i + Math.random()))); // 第1个距离库的水平速度
            list.get(2).add(String.valueOf(twoDecimal(30 + i + Math.random()))); // 第1个距离库的水平风向
            list.get(3).add(String.valueOf(twoDecimal(30 + i + Math.random()))); // 第1个距离库的信噪比
            list.get(4).add(String.valueOf(twoDecimal(30 + i + Math.random()))); // 第1个距离库的垂直风速
            list.get(5).add(String.valueOf(twoDecimal(30 + i + Math.random()))); // 第1个距离库的数据获取率
            list.get(6).add(String.valueOf(twoDecimal(30 + i + Math.random()))); // 第1个距离库的标准方差
            list.get(7).add(String.valueOf(twoDecimal(30 + i + Math.random()))); // 第1个距离库的最大风速值
            list.get(8).add(String.valueOf(twoDecimal(30 + i + Math.random()))); // 第1个距离库的最小风速值
            list.get(9).add(String.valueOf(twoDecimal(30 + i + Math.random()))); // 第1个距离库的Z标准方差


        }
        RadarData data = new RadarData().setBoatCode(boatCode)
                .setTime(new Date())
                .setLng(twoDecimal(120 + Math.random()))
                .setLat(twoDecimal(30 + Math.random()))
                .setLaserStatus(0)
                .setAmplifierStatus(1)
                .setLaserPower(twoDecimal(20 + Math.random()))
                .setAmplifierPower(twoDecimal(20 + Math.random()))
                .setLaserTemp(twoDecimal(30 + Math.random()))
                .setAmplifierTemp(twoDecimal(30 + Math.random()))
                .setModuleTemp(twoDecimal(30 + Math.random()))
                .setModuleHumidity(twoDecimal(20 + Math.random()))
                .setInputVoltage(twoDecimal(20 + Math.random()))
                .setMeasurementStatus(1)
                .setDiskSpace(twoDecimal(20 + Math.random()))
//                .setDistanceList(list.get(0))
//                .setHSpeedList(list.get(1))
//                .setHDirectionList(list.get(2))
//                .setRatioList(list.get(3))
//                .setVSpeedList(list.get(4))
//                .setDataRateList(list.get(5))
//                .setSDeviationList(list.get(6))
//                .setMaxSpeedList(list.get(7))
//                .setMinSpeedList(list.get(8))
//                .setZDeviationList(list.get(9));
                .setDistanceList(String.join(",", list.get(0)))
                .setHSpeedList(String.join(",", list.get(1)))
                .setHDirectionList(String.join(",", list.get(2)))
                .setRatioList(String.join(",", list.get(3)))
                .setVSpeedList(String.join(",", list.get(4)))
                .setDataRateList(String.join(",", list.get(5)))
                .setSDeviationList(String.join(",", list.get(6)))
                .setMaxSpeedList(String.join(",", list.get(7)))
                .setMinSpeedList(String.join(",", list.get(8)))
                .setZDeviationList(String.join(",", list.get(9)));
        radarDataService.insertRadarData(data);
        websocketService.sendRadarData(data);
    }

    public void mockAisData(String boatCode) {
        if (boatCode == null) boatCode = "00";
        AisData data = new AisData().setBoatCode(boatCode)
                .setTime(new Date())
                .setLng(toFixed(120.0 + Math.random(), 7))
                .setLat(toFixed(30.0 + Math.random(), 7))
                .setCount(4);

        StringBuilder mmsiStr = new StringBuilder();
        StringBuilder latStr = new StringBuilder();
        StringBuilder lngStr = new StringBuilder();
        StringBuilder speedStr = new StringBuilder();
        StringBuilder directionStr = new StringBuilder();
        for (int i = 0; i < 4; i++) {
            if (i > 0) {
                mmsiStr.append(",");
                latStr.append(",");
                lngStr.append(",");
                speedStr.append(",");
                directionStr.append(",");
            }
            String mmsi = "1234567";
            mmsiStr.append(mmsi);
            String lng = String.valueOf(twoDecimal(120.0 + Math.random()));
            lngStr.append(lng);
            String lat = String.valueOf(twoDecimal(30.0 + Math.random()));
            latStr.append(lat);
            String speed = String.valueOf(twoDecimal(10.0 + Math.random()));
            speedStr.append(speed);
            String direction = String.valueOf(twoDecimal(20.0 + Math.random() * 10));
            directionStr.append(direction);
        }

        data.setMmsiList(mmsiStr.toString())
                .setLatList(latStr.toString())
                .setLngList(lngStr.toString())
                .setSpeedList(speedStr.toString())
                .setDirectionList(directionStr.toString());

        aisDataService.insertAisData(data);
        websocketService.sendAisData(data);
    }


    public void testWsByCode(String boatCode) {
        if (boatCode == null) boatCode = "00";
        websocketService.sendToCode(boatCode, "test", null);
    }

    public void mockCtdData(String boatCode) {
        if (boatCode == null) boatCode = "00";

        StringBuilder tempStr = new StringBuilder();
        StringBuilder salinityStr = new StringBuilder();
        StringBuilder pressureStr = new StringBuilder();
        for (int i = 0; i < 50; i++) {
            if (i != 0) {
                tempStr.append(",");
                salinityStr.append(",");
                pressureStr.append(",");
            }
            String temp = String.valueOf(twoDecimal(10 + Math.random() * 2));
            tempStr.append(temp);
            String salinity = String.valueOf(twoDecimal(12 + Math.random() * 3));
            salinityStr.append(salinity);
            String pressure = String.valueOf(twoDecimal(800 + Math.random() * 200));
            pressureStr.append(pressure);
        }

        CtdData data = new CtdData().setBoatCode(boatCode).setTime(new Date()).setCount(50)
                .setTempList(tempStr.toString())
                .setSalinityList(salinityStr.toString())
                .setPressureList(pressureStr.toString());

        ctdDataService.insertCtdData(data);
        websocketService.sendCtdData(data);
    }

    public void mockAdcpData(String boatCode) {
        if (boatCode == null) boatCode = "00";

        StringBuilder speedStr = new StringBuilder();
        StringBuilder directionStr = new StringBuilder();
        for (int i = 0; i < 10; i++) {
            if (i != 0) {
                speedStr.append(",");
                directionStr.append(",");
            }
            String temp = String.valueOf(twoDecimal(10 + Math.random() * 2));
            speedStr.append(temp);
            String salinity = String.valueOf(twoDecimal(12 + Math.random() * 3));
            directionStr.append(salinity);
        }

        AdcpData data = new AdcpData().setBoatCode(boatCode).setTime(new Date())
                .setSpeedList(speedStr.toString())
                .setDirectionList(directionStr.toString());

        adcpDataService.insertAdcpData(data);
        websocketService.sendAdcpData(data);
    }

    /*
    测风雷达案例

    68 32 32
    68 01 00
    07 // 姿态
    01
    A0 B2 66 64
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 16
    68 D0 D0
    68 00 01
    0A // 风
    01 // 包号
    A1 B2 66 64
    36 00 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    52 00 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    6D 00 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    89 00 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    A4 00 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    BF 00 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    DB 00 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    F6 00 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    12 01 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    2D 01 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    78 16

    68 D0 D0
    68 00 01
    0A
    02
    A1 B2 66 64
    49 01 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    64 01 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    7F 01 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    9B 01 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    B6 01 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    D2 01 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    ED 01 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    08 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    24 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    3F 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    3A 16

    68 D0 D0 68 00 01 0A
    03
    A1 B2 66 64
    5B 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    76 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    92 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    AD 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    C8 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    E4 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    FF 02 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    1B 03 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    36 03 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    51 03 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    FB 16

    68 D0 D0 68 00 01 0A
    04
    A1 B2 66 64
    6D 03 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    88 03 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    A4 03 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    BF 03 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    DB 03 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    F6 03 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    11 04 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    2D 04 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    48 04 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    64 04 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    BD 16

    68 D0 D0 68 00 01 0A
    05
    A1 B2 66 64
    7F 04 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    9B 04 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    B6 04 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    D1 04 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    ED 04 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    08 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    24 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    3F 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    5A 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    76 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    7F 16

    68 D0 D0 68 00 01 0A
    06
    A1 B2 66 64
    91 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    AD 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    C8 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    E4 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    FF 05 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    1A 06 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    36 06 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    51 06 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    6D 06 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    88 06 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86
    40 16

    68 D0 D0 68 00 01 0A
    07
    A1 B2 66 64
    A3 06 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 BF 06 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 DA 06 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 F6 06 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 11 07 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 2D 07 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 48 07 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 63 07 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 7F 07 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 9A 07 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 01 16

    68 D0 D0 68 00 01 0A
    08
    A1 B2 66 64
    B6 07 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 D1 07 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 ED 07 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 08 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 23 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 3F 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 5A 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 76 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 91 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 AC 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 C4 16

    68 D0 D0 68 00 01 0A
    09
    A1 B2 66 64
    C8 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 E3 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 FF 08 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 1A 09 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 36 09 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 51 09 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 6C 09 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 88 09 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 A3 09 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 BF 09 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 85 16

    68 D0 D0 68 00 01 0A
    0A
    A1 B2 66 64 DA 09 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 F5 09 FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 11 0A FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 2C 0A FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 48 0A FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 63 0A FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 7F 0A FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 9A 0A FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 B5 0A FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 D1 0A FF FF FF FF 00 00 FF FF 00 00 3C 86 00 00 00 00 3C 86 46 16

    68 22 22
    68 00 01
    01 // 雷达状态
    01
    A2 B2 66 64
    00 00 00 00 00 00 00 00 80 80 F6 09 00 00 04 10 00 00 74 0E 1C 0C 60 09 5B 00 B6 16
     */
}
